/* GUI CONVERTED from iclorp01.p (converter v1.76) Thu May 30 14:00:33 2002 */
/* iclorp01.p - LOCATION MASTER REPORT                                        */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/* $Revision: 1.15 $                                                          */
/*V8:ConvertMode=FullGUIReport                                                */
/* REVISION: 7.0      LAST MODIFIED: 01/30/92    BY: emb      *F114*          */
/* REVISION: 7.0      LAST MODIFIED: 04/09/92    BY: emb      *F372*          */
/* REVISION: 8.5      LAST MODIFIED: 07/28/95    BY: bholmes  *J0FY*          */
/* REVISION: 8.6      LAST MODIFIED: 11/25/96    BY: gym      *K02C*          */
/* REVISION: 8.6      LAST MODIFIED: 10/07/97    BY: mzv      *K0M8*          */
/* REVISION: 8.6E     LAST MODIFIED: 02/23/98    BY: *L007* A. Rahane         */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98    BY: *J314* Alfred Tan        */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00    BY: *N08T* Annasaheb Rahane  */
/* REVISION: 9.1      LAST MODIFIED: 09/05/00    BY: *N0RF* Mark Brown        */
/* REVISION: 9.1      LAST MODIFIED: 08/11/00    BY: *N0K2* Phil DeRogatis    */
/* Old ECO marker removed, but no ECO header exists *F0PN*                    */
/* Revision: 1.14     BY: Jean Miller          DATE: 04/06/02  ECO: *P056*    */
/* $Revision: 1.15 $ BY: Patrick Rowan DATE: 05/24/02  ECO: *P018* */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/

/* DISPLAY TITLE */

/*GUI global preprocessor directive settings */
&GLOBAL-DEFINE PP_PGM_RP TRUE
&GLOBAL-DEFINE PP_ENV_GUI TRUE


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

{mfdtitle.i "2+ "}

/* CONSIGNMENT INVENTORY VARIABLES */
{pocnvars.i}

define variable site like ld_site.
define variable site1 like ld_site.
define variable loc like ld_loc.
define variable loc1 like ld_loc.
define variable w-ext-whl  like whl_mstr.whl_src_dest_id .
define variable w-ext-whl1 like whl_mstr.whl_src_dest_id.
define variable w-loc-site like loc_mstr.loc_site.
DEFINE VARIABLE dptdesc    LIKE dpt_desc.
define variable disp-export-comment as character no-undo format "x(16)".
define variable disp-export-data    as character no-undo format "x(12)".

assign
   disp-export-comment = getTermLabel("EXPORT_COMMENTS",15) + ":"
   disp-export-data = getTermLabel("EXPORT_DATA",11) + ":".

/* SELECT FORM */

/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
   
 RECT-FRAME       AT ROW 1.4 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1   COLUMN 3 NO-LABEL
 SKIP(.1)  /*GUI*/
site           colon 19
   site1          label "To" colon 49 skip
   loc            colon 19
   loc1           label "To" colon 49 skip
   w-ext-whl      label "External Warehouse" colon 19
   w-ext-whl1     label "To" colon 49 skip
 SKIP(.4)  /*GUI*/
with frame a side-labels width 80 attr-space NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER.
 F-a-title = &IF (DEFINED(SELECTION_CRITERIA) = 0)
  &THEN " Selection Criteria "
  &ELSE {&SELECTION_CRITERIA}
  &ENDIF .
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:WIDTH-PIXELS in frame a =
  FONT-TABLE:GET-TEXT-WIDTH-PIXELS(
  RECT-FRAME-LABEL:SCREEN-VALUE in frame a + " ", RECT-FRAME-LABEL:FONT).
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5. /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



/* SET EXTERNAL LABELS */
setFrameLabels(frame a:handle).

/* DETERMINE IF SUPPLIER CONSIGNMENT IS ACTIVE */
{gprun.i ""gpmfc01.p""
         "(input ENABLE_SUPPLIER_CONSIGNMENT,
           input 11,
           input ADG,
           input SUPPLIER_CONSIGN_CTRL_TABLE,
           output using_supplier_consignment)"}

/* REPORT BLOCK */
{wbrp01.i}


/*GUI*/ {mfguirpa.i true "printer" 132 " " " " " "  }

/*GUI repeat : */
/*GUI*/ procedure p-enable-ui:


   if site1 = hi_char then site1 = "".
   if loc1 = hi_char then loc1 = "".
   if w-ext-whl1 = hi_char then w-ext-whl1 = "".

   if c-application-mode <> 'web' then
   
run p-action-fields (input "display").
run p-action-fields (input "enable").
end procedure. /* p-enable-ui, replacement of Data-Entry GUI*/

/*GUI*/ procedure p-report-quote:


   {wbrp06.i &command = update &fields = "site site1 loc loc1 w-ext-whl
        w-ext-whl1" &frm = "a"}

   if (c-application-mode <> 'web') or
      (c-application-mode = 'web' and
      (c-web-request begins 'data'))
   then do:

      bcdparm = "".
      {mfquoter.i site      }
      {mfquoter.i site1     }
      {mfquoter.i loc       }
      {mfquoter.i loc1      }
      {mfquoter.i w-ext-whl }
      {mfquoter.i w-ext-whl1}

      if site1 = "" then site1 = hi_char.
      if loc1 = "" then loc1 = hi_char.
      if w-ext-whl1 = "" then w-ext-whl1 = hi_char.
   end.

   /* OUTPUT DESTINATION SELECTION */
   
/*GUI*/ end procedure. /* p-report-quote */
/*GUI - Field Trigger Section */

/*GUI MFSELxxx removed*/
/*GUI*/ procedure p-report:
/*GUI*/   {gpprtrpa.i "printer" 132 " " " " " " " " }
/*GUI*/   mainloop: do on error undo, return error on endkey undo, return error:




   {mfphead.i}

   FORM /*GUI*/ 
      loc_site
      loc_loc
      loc_desc
      loc_type
      loc_perm
      loc_single
      loc__qad01 column-label "Single!Lot"
      loc_cap
      loc_cap_um column-label "UM"
      loc_date
      loc_status
      is_avail
      is_nettable
      is_overissue
      loc_xfer_ownership column-label "Xfer"
   with STREAM-IO /*GUI*/  frame b width 132 no-attr-space down.

   /* SET EXTERNAL LABELS */
   setFrameLabels(frame b:handle).

   FORM /*GUI*/ 
      disp-export-data no-label at 1
      whl_mstr.whl_cust_exp at 19
      whl_mstr.whl_sup_exp            at 28
      whl_mstr.whl_rps_exp            at 37
      whl_mstr.whl_pt_exp             at 48
      whl_mstr.whl_um_exp             at 53
      whl_mstr.whl_cust_item_nbr_exp  at 57
      whl_mstr.whl_sup_item_nbr_exp   at 66 column-label "Supplier!Number"
      whl_mstr.whl_so_exp             at 75
      whl_mstr.whl_wo_exp             at 81
      whl_mstr.whl_po_exp             at 87
      whl_mstr.whl_do_exp             at 96
      whl_mstr.whl_do_req_exp         at 109 skip
   with STREAM-IO /*GUI*/  frame c width 132 down no-attr-space no-box.

   /* SET EXTERNAL LABELS */
   setFrameLabels(frame c:handle).

   FORM /*GUI*/ 
      disp-export-comment no-label at 1
      whl_mstr.whl_so_cmt_exp no-label      at 75
      whl_mstr.whl_wo_cmt_exp no-label      at 81
      whl_mstr.whl_po_cmt_exp no-label      at 87
      whl_mstr.whl_do_cmt_exp no-label      at 96
      whl_mstr.whl_do_req_cmt_exp no-label  at 109
   with frame c2  width 132 no-attr-space overlay no-box THREE-D /*GUI*/.


   /* SET EXTERNAL LABELS */
   setFrameLabels(frame c2:handle).

   FORM /*GUI*/ 
      
 RECT-FRAME       AT ROW 1.4 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1   COLUMN 3 NO-LABEL
 SKIP(.1)  /*GUI*/
skip(1)
      whl_mstr.whl_src_dest_id   colon 20
      whl_mstr.whl_act           colon 20 skip
    SKIP(.4)  /*GUI*/
with frame c3  side-labels no-attr-space overlay no-box THREE-D /*GUI*/.

 DEFINE VARIABLE F-c3-title AS CHARACTER.
 F-c3-title = &IF (DEFINED(SELECTION_CRITERIA) = 0)
  &THEN " Selection Criteria "
  &ELSE {&SELECTION_CRITERIA}
  &ENDIF .
 RECT-FRAME-LABEL:SCREEN-VALUE in frame c3 = F-c3-title.
 RECT-FRAME-LABEL:WIDTH-PIXELS in frame c3 =
  FONT-TABLE:GET-TEXT-WIDTH-PIXELS(
  RECT-FRAME-LABEL:SCREEN-VALUE in frame c3 + " ", RECT-FRAME-LABEL:FONT).
 RECT-FRAME:HEIGHT-PIXELS in frame c3 =
  FRAME c3:HEIGHT-PIXELS - RECT-FRAME:Y in frame c3 - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME c3 = FRAME c3:WIDTH-CHARS - .5. /*GUI*/


   /* SET EXTERNAL LABELS */
   setFrameLabels(frame c3:handle).

   w-loc-site = "".

   for each loc_mstr no-lock
      where loc_site >= site
      and loc_site <= site1
      and (loc_loc >= loc and loc_loc <= loc1),
      each si_mstr no-lock where si_site = loc_site,
      each is_mstr no-lock where is_status = loc_status
   break by loc_site by loc_loc
   with frame b width 132:
       ASSIGN dptdesc = "".
       FIND FIRST dpt_mstr NO-LOCK WHERE dpt_dept = loc_user1 NO-ERROR.
       IF AVAIL dpt_mstr THEN DO:
           ASSIGN dptdesc = dpt_desc.
       END.

      find first whl_mstr where whl_site = loc_site
                            and whl_loc  = loc_loc
      no-lock no-error.
        
      if not available whl_mstr and w-ext-whl > "" then next.
      if not available whl_mstr and w-ext-whl1 <> hi_char then next.

      if available whl_mstr
      then do:
         if whl_src_dest_id < w-ext-whl
         or whl_src_dest_id > w-ext-whl1
         then
            next.
      end.

      if page-size - line-counter < 2 then page.

      if loc_site <> w-loc-site
      then do with frame b:

         w-loc-site = loc_site.

         display
            loc_site
            si_desc @ loc_desc WITH STREAM-IO /*GUI*/ .

         down 1.

         display
            loc_loc
            loc_desc
            loc_type
            loc_perm
            loc_single
            loc__qad01
            loc_cap
            loc_cap_um
            loc_date
            loc_status
            is_avail
            is_nettable
            is_overissue
            loc_xfer_ownership when (using_supplier_consignment) 
            loc_user1  
            dptdesc 
            WITH WIDTH 300 STREAM-IO /*GUI*/ .
      end.

      else do with frame b:
         display
            loc_loc
            loc_desc
            loc_type
            loc_perm
            loc_single
            loc__qad01
            loc_cap
            loc_cap_um
            loc_date
            loc_status
            is_avail
            is_nettable
            is_overissue
            loc_xfer_ownership when (using_supplier_consignment)
            loc_user1    
            dptdesc
            WITH WIDTH 300 STREAM-IO /*GUI*/ .
      end.

      if available whl_mstr
      then do:
         display
            whl_mstr.whl_act
            whl_mstr.whl_src_dest_id
         with frame c3 STREAM-IO /*GUI*/ .

         display
            disp-export-data
            whl_mstr.whl_cust_exp
            whl_mstr.whl_sup_exp
            whl_mstr.whl_rps_exp
            whl_mstr.whl_so_exp
            whl_mstr.whl_pt_exp
            whl_mstr.whl_um_exp
            whl_mstr.whl_cust_item_nbr_exp
            whl_mstr.whl_sup_item_nbr_exp
            whl_mstr.whl_wo_exp
            whl_mstr.whl_po_exp
            whl_mstr.whl_do_exp
            whl_mstr.whl_do_req_exp
         with frame c STREAM-IO /*GUI*/ .

         display
            disp-export-comment
            whl_mstr.whl_so_cmt_exp
            whl_mstr.whl_wo_cmt_exp
            whl_mstr.whl_po_cmt_exp
            whl_mstr.whl_do_cmt_exp
            whl_mstr.whl_do_req_cmt_exp
         with frame c2 STREAM-IO /*GUI*/ .

      end.

      down 1.

      if last-of (loc_site) and page-size - line-counter > 1
         then down 1.

      
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/


   end.

   /* REPORT TRAILER  */
   
/*GUI*/ {mfguitrl.i} /*Replace mfrtrail*/

/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/


end.

{wbrp04.i &frame-spec = a}

/*GUI*/ end procedure. /*p-report*/
/*GUI*/ {mfguirpb.i &flds=" site site1 loc loc1 w-ext-whl w-ext-whl1 "} /*Drive the Report*/
